package com.groot.springbootmybatis.common;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @program: spring-boot-mybatis
 * @description:
 * @author: SnailThink
 * @create: 2020-07-14 15:17
 **/
@Configuration
public class DataSourceConfig {

	@Bean(name = "octMybatisDataSource")
	@Qualifier("octMybatisDataSource")
	@ConfigurationProperties(prefix = "spring.datasource")
	public DataSource octMybatisDataSource() {
		DruidDataSource dataSource = new DruidDataSource();
		return dataSource;
	}
}
